package com.ctshk.rpc.localfun.service;

import com.ctshk.common.dto.Result;
import com.ctshk.common.model.PageResponse;
import com.ctshk.common.model.TokenUser;
import com.ctshk.rpc.localfun.dto.*;
import com.ctshk.rpc.localfun.req.*;

import java.math.BigDecimal;
import java.text.ParseException;
import java.time.LocalDate;
import java.util.List;

/**
 * @Description 当地玩乐-产品中心
 * @Author wansi <gaylen15527491065@yeah.net>
 * @Date 2021/3/24
 */
public interface ILocalFunProductService {

    /**
     * 产品中心-查询产品列表
     * @param localFunProductListReq
     * @param currentUser
     * @return
     */
    PageResponse<LocalFunProductListDTO> list(LocalFunProductListReq localFunProductListReq, TokenUser currentUser);

    /**
     * 修改产品推荐状态
     * @param localFunProductModifyRecommendStatusReq
     * @param currentUser
     * @return
     */
    Result modifyRecommendStatus(LocalFunProductModifyRecommendStatusReq localFunProductModifyRecommendStatusReq, TokenUser currentUser);

    /**
     * 产品上架新增
     * @param localFunProductBatchSaleStrategyReq
     * @param currentUser
     * @return
     */
    Result putAway(LocalFunProductBatchSaleStrategyReq localFunProductBatchSaleStrategyReq, TokenUser currentUser);

    /**
     * 产品上架编辑
     * @param localFunProductEditReq
     * @return
     */
    Result<List<LocalFunProductSaleStrategyDTO>> LocalFunProductEditDetai(LocalFunProductEditReq localFunProductEditReq);

    /**
     * 上架详情
     * @param localFunProductBatchSaleStrategyReq
     * @param currentUser
     * @return
     */
    Result<LocalFunStockDetailDTO> stockDetail(LocalFunProductStockDetailReq localFunProductBatchSaleStrategyReq, TokenUser currentUser);

    /**
     * 产品上架详情
     * @param localFunProductReq
     * @return
     */
    Result<LocalFunProductDetailDTO> LocalFunProductDetail(LocalFunProductReq localFunProductReq) throws ParseException;

    Result<List<LocalFunProductSaleStrategyDTO>> localFunProductEditDetai(LocalFunProductEditReq localFunProductEditReq);

    Result localFunProductEdit(LocalFunProductBatchSaleStrategyReq localFunProductModifyRecommendStatusReq, TokenUser currentUser);

    Result<List<LocalFunProductListDTO>> localFunProductList(LocalFunProductReq localFunProductReq);

    Result<LocalFunProductTicketDTO>  localFunProductTicketPrice(LocalFunProductTicketReq localFunProductTicketReq);

    Result<LocalFunProductDetailByIdDTO> localFunProductDetailByIdDTO(LocalFunProductDetailReq localFunProductDetailReq);

    Result<LocalFunProductTicketDetailDTO>  localFunProductTicketDetail(LocalFunProductTicketDetailReq localFunProductTicketDetailReq);

    Result modifyProductTicket(List<LocalFunProductTicketListReq> localFunProductTicketListReqList,TokenUser tokenUser);


    Result<LocalFunProductReceiptDTO> localFunProductDetail(LocalFunProductDetailReq scenicProductDetailReq);

    /**
     * 動態套票產品列表
     * @param req
     * @return
     */
    Result<PageResponse<LocalFunDyTicketProductDTO>> getLocalFunDyTicketProductList(LocalFunDyTicketProductReq req);


    /**
     * 根據時間獲取具體的幅加策略
     * @param queryDate
     * @param productId
     * @return
     */
    Result<Long> getExactStrategyId(LocalDate queryDate,Long productId);

    /**
     * 查询线下代理商
     * @param req
     * @return
     */
    Result<PageResponse<AgentDto>> queryAgentList(AgentReq req);

    /**
     * 查询当地玩乐产品价格
     * @param localFunId
     * @param channelId
     * @return
     */
    BigDecimal queryLocalFunPrice(Long localFunId,Long channelId);


    /**
     * 查询当地玩乐产品售价信息逻辑处理
     * @param strategyType 加幅类型，1：自营；2：代理；3：官方平台；4：第三方平台；
     * @param productId 产品ID
     * @param departureDate 出发日期
     * @param relId 关联ID，strategyType(1：用户ID；2：代理ID；3：渠道ID；4：渠道ID)
     * @param attrId1   規格ID1
     * @param attrId2   規格ID2  倆個規格ID都空，則選擇默認最小價格展示
     * @return
     */
    LocalFunPriceRemainderDTO findLocalFunSalePriceInfoHandle(int strategyType, Long productId, LocalDate departureDate, Long relId, Long attrId1 ,Long attrId2);



    /**
     * 查询当地玩乐产品售价信息逻辑处理
     * @param strategyType 加幅类型，1：自营；2：代理；3：官方平台；4：第三方平台；
     * @param productId 产品ID
     * @param departureDate 出发日期
     * @param relId 关联ID，strategyType(1：用户ID；2：代理ID；3：渠道ID；4：渠道ID)
     * @return
     */
    List<LocalFunPriceRemainderDTO> findLocalFunSalePriceInfoHandleList(int strategyType, Long productId, LocalDate departureDate, Long relId);

    /**
     * 查询代理列表
     * @param req
     * @return
     */
    List<AgentDto> queryAgentList2(AgentReq req);


    /**
     * 获取线下关联信息 扣减库存
     * @param productId 产品ID
     * @param agent 是的代理商 1 自营 2代理商
     * @param userId 用户ID 可获取用户部门
     * @param agencyId
     * @return
     */
    CustomDto getCustomSelLine(Long productId, Integer agent, Long userId, Long agencyId);
}
